<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function fun(arr) {
        for (i = 0; i < arr.length; i++) {
          //   if (typeof arr[i] != "number" && typeof arr[i] != "string"&&typeof arr[i] != "undefined")
          if (typeof arr[i] == "function") {
            arr[i]();
          }
        }
      }
      function hanshu() {}
      var arr = [
        "1212",
        "张三",
        function () {
          console.log(111);
        },
        "李四",
        function () {
          console.log(256);
        },
      ];
      fun(arr);
      var a = typeof hanshu;
      //名称为hanshu的变量 类型是function arr[i]实际是相当于函数名 所以判断arr[i]是不是function就行
      console.log(a);
    </script>
  </body>
</html>
